# -*- coding: utf-8 -*-
# ===========================================
# @Time    : 2021/9/23 14:56 
# @Author  : shutao
# @FileName: custom_layer.py
# @remark  : 
# 
# @Software: PyCharm
# Github 　： https://github.com/NameLacker
# ===========================================

import paddle
import paddle.nn.functional as F
import numpy as np
import warnings

warnings.filterwarnings("ignore")

from paddle.utils.cpp_extension import load
custom_ops = load(
    name="custom_jit_ops",
    sources=[
        # "custom_op/custom_clip_cpu.cc",
        # "custom_op/custom_clip_cuda.cc",
        "./custom_op/custom_clip.cc",
        "./custom_op/custom_clip_cuda.cu"])

custom_clip = custom_ops.custom_clip

'''
Found that your compiler (cl == 18.00.30501) may be ABI-incompatible with pre-installed Paddle!
Please use compiler that is ABI-compatible with GCC >= 5.4 (Recommended 8.2)
'''